package com.rw.coco.api.data.modle;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Objects;

/**
 * 角色的属性对象
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CharacterPropertyModel {
    /**
     * 角色ID
     */
    private int characterId;

    /**
     * 角色的属性名
     */
    private String propertiesName;

    /**
     * 角色的属性值
     */
    private int propertiesValue;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CharacterPropertyModel that = (CharacterPropertyModel) o;
        return characterId == that.characterId && propertiesName.equals(that.propertiesName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(characterId, propertiesName);
    }
}
